/**
 * getRepairTypeList   获取报修类型列表
 * getInfoRepairType   获取报修类型信息
 */
const repairTypeStatement = require("../../common/sql_sentences/repair_type")

exports.getInfoRepairType = async (req, res) => {
  try {
    // 获取报修类型信息
    let sqlStr = repairTypeStatement.idSelect(req.body.id)
    let results = await RunSQL(sqlStr)
    if (results.length !== 1) return res.successSend("获取报修类型信息失败！", 10005)
    return res.successSend("", 10000, results[0])
  } catch (error) {
    res.errSend(error)
  }
}

exports.getRepairTypeList = async (req, res) => {
  try {
    // 获取报修类型
    let sqlStr = repairTypeStatement.select()
    let results = await RunSQL(sqlStr)
    return res.successSend(
      "",
      10000,
      results,
    )
  } catch (error) {
    res.errSend(error)
  }
}

